package com.design.demo.observer;

import java.util.List;
import java.util.Observer;

/**
 * @author guoliang.li
 * @date 2019/12/27 17:15
 * @description TODO
 */
public class WealthData implements Subject {

    private List<Observer> observers;

    public WealthData() {
    }

    @Override
    public void registerObserver(Observer o) {
        observers.add(o);
    }

    @Override
    public void removeObserver(Observer o) {
        int i = observers.indexOf(o);
        if (i != -1){
            observers.remove(o);
        }
    }

    @Override
    public void notifyObservers() {

    }
}
